<?php
namespace app\api\controller;
use think\Model;
use think\Config;
use EasyWeChat\Factory;
use app\common\controller\Api;
class Wehcat extends Api{
	public function _initialize(){
		$appid=Config::get('mzpay.wx_appid');
		$mch_id=Config::get('mzpay.wx_mchid');
	}
	
	//下载对账单
	public function getBill(){
		
	}
	public function scan($auth_code,$total_fee){
		$config = [
    'app_id'             => 'xxxx',
    'mch_id'             => 'your-mch-id',
    'key'                => 'key-for-signature',
    'cert_path'          => 'path/to/your/cert.pem', 
    'key_path'           => 'path/to/your/key', 
    'notify_url'         => '默认的订单回调地址',  
];

$app = Factory::payment($config);
$app->setSubMerchant('sub-merchant-id', 'sub-app-id');
$result = $app->pay([
    'body' => 'image形象店-深圳腾大- QQ公仔',
    'out_trade_no' => '1217752501201407033233368018',
    'total_fee' => $total_fee*100,
    'auth_code' => $auth_code,
]);
if($result['return_code']=='SUCCESS'&&$result['result_code']=='SUCCESS'){
	
}

	}
}